package com.linzm.leetcode.mid.tree.其他;

/**
 * @Author zimingl
 * @Date 2023/2/19 12:43
 * @Description: TODO
 */
public class TreeNode {
    public int val;
    public TreeNode left;
    public TreeNode right;
    public TreeNode next;

    public TreeNode() {}

    public TreeNode(int _val) {
        val = _val;
    }

    public TreeNode(int _val, TreeNode _left, TreeNode _right, TreeNode _next) {
        val = _val;
        left = _left;
        right = _right;
        next = _next;
    }

    public static TreeNode getTree() {
        // 0-1,2 1-3,4 2-5,6
        TreeNode three = new TreeNode(3);
        TreeNode four = new TreeNode(4);
        TreeNode five = new TreeNode(5);
        TreeNode sex = new TreeNode(6);
        TreeNode one = new TreeNode(1, four, three, null);
        TreeNode two = new TreeNode(2, sex, five, null);
        return new TreeNode(0, one, two, null);
    }
}
